package com.gitee.huxing.klass;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Import;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @Description: 加载打印测试类
 * @ProjectName: JavaCourse
 * @Package: com.gitee.huxing.klass
 * @ClassName: Klass
 * @Author: huxing
 * @DateTime: 2021-09-04 下午10:32
 */
@Slf4j
@Import(School.class)
public class Klass {

    @Autowired
    School school;

    /**
     * @Description: 打印校内学生信息
     * @Author: huxing
     * @Date: 2021/9/4 下午10:33
     **/
    public School printStudents(){
        log.info("当前学校内的学生信息: {}", school.getStudents().toString());
        return school;
    }

    /**
     * @Description:  测试打印
     * @Author: huxing
     * @Date: 2021/9/4 下午10:52
     **/
    public void test(){
        log.info("这个类已经被成功加载上了: {}", LocalDateTime.now());
        log.info("当前加载的学校: {}", school.getName());
        log.info("学校地址: {}", school.getName());
    }
}
